<template>
	<view>
		<u-navbar title="填写入职信息" rightText="保存" placeholder="true" @rightClick="into" @leftClick="leftClick" :autoBack="true">
		</u-navbar>
		<view>
			<view>
				<h3 class="h">基础信息</h3>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">姓名</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.name"></u--input>
				</view>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">身份证号</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.idNumber"></u--input>
				</view>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">手机号</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.phone"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">性别</text></view>
					<radio-group @change="radioChange" class="shuru1">
						<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in sex" :key="item.value">
							<radio :value="item.value" :checked="item.checked" /><span>{{item.label}}</span>
						</label>
					</radio-group>
					<!-- <radio-group name="sex" @change="radioChange">
					 <label>
						<radio value="1" checked="checked" /><text>男</text>	
					 	<radio value="2" /><text>女</text>
					</label>
					</radio-group> -->
				</view>
				<view>
					<view class="txt"><text class="tet">出生日期</text></view>
					<uni-datetime-picker class="shuru1" type="date" v-model="data.birthday" :clear-icon="false"
						@maskClick="maskClick" />
					<!-- <u--input
						type="date"
						class="shuru"
					    placeholder="请输入"
					    border="surround"
					    v-model="data.birthday"
					  ></u--input> -->
				</view>
				<view>
					<view class="txt"><text class="tet">民族</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.nation"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">籍贯</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.place"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">户籍类型</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.registered"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">户籍地址</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.address"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">现居地址</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.currentAddress">
					</u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">婚姻状况</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.marital"></u--input>

				</view>
				<view>
					<view class="txt"><text class="tet">邮箱地址</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.email"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">微信</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.wechat"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">QQ</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.qq"></u--input>
				</view>
			</view>
		</view>
		<view class="danyuan">
			<u-cell-group>
				<u-cell size="large" title="家庭成员" value="添加" @click="jiating()"></u-cell>
				<u-cell size="large" title="证书" value="添加" @click="zhengshu()"></u-cell>
				<u-cell size="large" title="技能" value="添加" @click="jineng()"></u-cell>
				<u-cell size="large" title="教育经历" value="添加" @click="jiaoyu()"></u-cell>
				<u-cell size="large" title="工作经历" value="添加" @click="gongzuo()"></u-cell>
				<u-cell size="large" title="项目经历" value="添加" @click="xiangmu()"></u-cell>
			</u-cell-group>
		</view>
		<view>
			<h3 class="h">工资卡信息</h3>
			<view>
				<view class="txt"><text class="tet">银行卡号</text></view>
				<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.bank"></u--input>
			</view>
			<view>
				<view class="txt"><text class="tet">开户行</text></view>
				<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.deposit"></u--input>
			</view>
			<view>
				<view class="txt"><text class="tet">备注</text></view>
				<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.remarks"></u--input>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sex: [{
					label: "男",
					value: 1,
					checked: true
				}, {
					label: "女",
					value: 0
				}],
				data: {
					jid: "",
					name: "",
					idNumber: "",
					phone: "",
					sex: "",
					birthday: "",
					nation: "",
					place: "",
					registered: "",
					address: "",
					currentAddress: "",
					marital: "",
					email: "",
					wechat: "",
					qq: "",
					bank: "",
					deposit: "",
					remarks: "",
					birthday: ""
				}
			}
		},
		onLoad(options) {
			this.data.jid = options.jId
			console.log(this.data.jId)
		},
		methods: {
			confirm(e) {
				console.log(e);
				this.data.birthday = e;
				this.show2 = false
			},
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			},
			into() {
				console.log(this.data),
					this.$request({
						url: 'entry/ruzhi/ruzhi',
						data: this.data,
						method: 'post',
						success: (res) => {
							this.review(),
								this.value = ""
						}
						
					})
					uni.navigateTo({
						url: "./ruzhi"
					})
			},

			radioChange(e) {
				this.data.sex = this.radio = e.detail.value
			},
			leftClick(){
				uni.navigateTo({
					url: "./ruzhi"
				})
			},
			jiating() {
				uni.navigateTo({
					url: "./jiating" + '?jid=' + this.data.jid
				})
			},
			zhengshu() {
				uni.navigateTo({
					url: "./zhengshu" + '?jid=' + this.data.jid
				})
			},
			jiaoyu() {
				uni.navigateTo({
					url: "./jiaoyu" + '?jid=' + this.data.jid
				})
			},
			jineng() {
				uni.navigateTo({
					url: "./jineng" + '?jid=' + this.data.jid
				})
			},
			gongzuo() {
				uni.navigateTo({
					url: "./gonzuo" + '?jid=' + this.data.jid
				})
			},
			xiangmu() {
				uni.navigateTo({
					url: "./xiangmu" + '?jid=' + this.data.jid
				})
			}

		}
	}
</script>
<style>
	.red {
		color: red;
	}

	.shuru {
		margin-top: 30rpx;
		height: 20px;
		float: left;
		width: 72%;
	}

	.txt {
		margin-left: 20rpx;
		margin-top: 30rpx;
		float: left;
		width: 17%;
	}

	.h {
		margin-left: 25rpx;
	}

	.danyuan {
		margin-top: 20rpx;
		float: left;
		width: 100%;
	}

	.tet {
		color: #74777a;
	}

	.shuru1 {
		margin-top: 30rpx;
		float: left;
		width: 80%;
	}
</style>
